From 9b49cea803afb755b570fbfbe05e372dd576bd21 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Fri, 31 Jul 2009 09:40:11 +0000 Subject: [PATCH] * The description message in $wgExtensionCredits can be an array with parameters now --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 6 ++++-- includes/specials/SpecialVersion.php | 9 ++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d5aeb3778b..bb31d5808a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -171,6 +171,7 @@ this. Was used when mwEmbed was going to be an extension. extension version in Special:Version * (bug 20014) Added CSS class "mw-listgrouprights-right-name" is wrapped on the right name in Special:ListGroupRights +* The description message in $wgExtensionCredits can be an array with parameters === Bug fixes in 1.16 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 14b817faf3..0944a1e66f 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2765,8 +2765,8 @@ $wgDebugJavaScript = false; * * $wgExtensionCredits[$type][] = array( * 'name' => 'Example extension', - * 'version' => 1.9, - * 'path' => __FILE__, + * 'version' => 1.9, + * 'path' => __FILE__, * 'author' => 'Foo Barstein', * 'url' => 'http://wwww.example.com/Example%20Extension/', * 'description' => 'An example extension', @@ -2775,6 +2775,8 @@ $wgDebugJavaScript = false; * * * Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'. + * Where 'descriptionmsg' can be an array with message key and parameters: + * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ), */ $wgExtensionCredits = array(); /* diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index ff2d97cc1d..0e4e49fb0b 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -473,7 +473,14 @@ class SpecialVersion extends SpecialPage { # Look for a localized description if( isset( $descriptionMsg ) ) { - $msg = wfMsg( $descriptionMsg ); + if( is_array( $descriptionMsg ) ) { + $descriptionMsgKey = $descriptionMsg[0]; // Get the message key + array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only + array_map( "htmlspecialchars", $descriptionMsg ); // For sanity + $msg = wfMsg( $descriptionMsgKey, $descriptionMsg ); + } else { + $msg = wfMsg( $descriptionMsg ); + } if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) { $description = $msg; } -- 2.20.1